Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add easyblock for RAxML #2180

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open

add easyblock for RAxML #2180

wants to merge 8 commits into from

Conversation

lexming
Copy link
Contributor

@lexming lexming commented Sep 16, 2020

This easyblock automatically builds those binaries of RAxML that

  1. use optimizations available in the CPU micro-architecture of the host system (respects optarch settings)
  2. have features compatible with the toolchain used in the build

Current easyconfigs of RAxML build one arbitrary binary of RAxML and create a symlink with the name raxmlHPC. This is a bad approach because the different binaries of RAxML have different requirements and features. For instance, binaries using MPI have a minimum number of trees to process

This is RAxML MPI Process Number: 0

WARNING: The number of threads is currently set to 0
You can specify the number of threads to run via -T numberOfThreads
NumberOfThreads must be set to an integer value greater than 1

RAxML, will now set the number of threads automatically to 2 !

Error: you are running the parallel MPI program but only want to compute one tree
For the MPI version you must specify a number of trees greater than 1 with the -# or -N option

@lexming lexming added the new label Sep 16, 2020
@lexming lexming added this to the 4.x milestone Sep 16, 2020
@lexming
Copy link
Contributor Author

lexming commented Sep 16, 2020

@lexming
Copy link
Contributor Author

lexming commented Feb 27, 2023

@lexming
Copy link
Contributor Author

lexming commented Feb 27, 2023

Test report by @lexming

Overview of tested easyconfigs (in order)

  • SUCCESS RAxML-8.2.12-GCC-11.3.0.eb
  • SUCCESS RAxML-8.2.12-gompi-2022a.eb

Build succeeded for 2 out of 2 (2 easyconfigs in total)
node300.hydra.os - Linux CentOS Linux 7.9.2009, x86_64, Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz (skylake_avx512), Python 3.6.8
See https://gist.github.com/c11b4d9e09219333dbd36fcf85a32ba3 for a full test report.

@boegel boegel modified the milestones: 4.x, next release (4.7.1) Mar 1, 2023
@boegel
Copy link
Member

boegel commented Mar 15, 2023

@lexming Some existing RAxML easyconfigs have raxmlHPC -v and raxmlHPC -h as sanity check commands, we can let this easyblock run those too?

from easybuild.tools.systemtools import get_cpu_features, HAVE_ARCHSPEC
from easybuild.tools.toolchain.compiler import OPTARCH_GENERIC

RAXML_BINARY_NAME = "raxmlHPC"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure RAXML_BINARY_NAME is useful, since it's only used in one place currently?


RAXML_BINARY_NAME = "raxmlHPC"
# Supported instruction sets ordered by priority (high to low) and related CPU features
RAXML_INSTRUCT_SETS = ["AVX2", "AVX", "SSE3"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about AVX-512? If there's a reason no to include that, add a comment on it?
Where can the list of supported instruction sets be found (docs link? README?)

Also, out of curiosity, does it also support NEON (for aarch64)?
If someone cares enough the easyblock can be updated later to also cover that, doesn't need to be done here.

# Supported instruction sets ordered by priority (high to low) and related CPU features
RAXML_INSTRUCT_SETS = ["AVX2", "AVX", "SSE3"]
RAXML_CPU_FEATURES = {
"SSE3": ["sse3", "see4_1", "sse4_2"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo:

Suggested change
"SSE3": ["sse3", "see4_1", "sse4_2"],
"SSE3": ["sse3", "sse4_1", "sse4_2"],

"""RAxML easyblock constructor, define class variables."""
super(EB_RAxML, self).__init__(*args, **kwargs)

def filter_optarch_features(support_features):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this a function outside of the easyblock? Same for others below.

Advantage is that tests can be added easily to CI for these, and code becomes quite a bit easier to parse for humans

return feature.lower() in host

try:
return any(f in get_cpu_features() for f in RAXML_CPU_FEATURES[feature])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nicer with a single return as the end, I'm not a big fan of inline returns, see also https://realpython.com/python-return-statement/#remembering-the-return-value (but that's partially personal, I guess)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this function should be moved into framework, it's pretty generic... Same for filter_optarch_features

# unrestricted optimization settings, set optimization level for host micro-architecture
cpu_features = [feat for feat in cpu_features if has_cpu_feature(feat)]
dbg_msg = "Enabling the following CPU optimizations for RAxML by autodetection: %s"
self.log.debug(dbg_msg, ", ".join(cpu_features))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this info log message?

dbg_msg = "Enabling the following CPU optimizations for RAxML by autodetection: %s"
self.log.debug(dbg_msg, ", ".join(cpu_features))
# add generic build
cpu_features.append(None)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you clarify (in the comment) why this is done?

parallel_features.extend(RAXML_PARALLEL_FEATURES["mpi"])

# List of builds to carry out
self.target_makefiles = list_filename_variants(cpu_features, parallel_features, "Makefile", "gcc", ".")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is always using gcc OK? What if we're installing RAxML with Intel compilers?

if not any(feature in mf for feature in RAXML_PARALLEL_FEATURES["mpi"]):
cc_opt = compiler_nompi
self.cfg["buildopts"] = '-f %s CC="%s" %s' % (mf, cc_opt, user_buildopts)
self.log.debug("Building RAxML makefile with %s: %s", cc_opt, mf)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log.info?

"files": [os.path.join("bin", x) for x in self.target_bins],
"dirs": ["share/manual", "share/usefulScripts"],
}
super(EB_RAxML, self).sanity_check_step(custom_paths=custom_paths)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also include a custom sanity check command like raxmlHPC -h?

@akesandgren
Copy link
Contributor

@lexming this easyblock needs some attention...

@boegel boegel removed this from the next release (4.8.2) milestone Oct 27, 2023
@boegel boegel added this to the release after 4.8.2 milestone Oct 27, 2023
@boegel boegel modified the milestones: 4.9.1, release after 4.9.1 Apr 3, 2024
@boegel boegel modified the milestones: 4.9.2, release after 4.9.2 Jun 6, 2024
@boegel boegel modified the milestones: 4.9.3, release after 4.9.3 Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants